package com.lc.cehui.ui.activity.mine;

import android.text.Html;
import android.widget.TextView;

import com.hjq.bar.TitleBar;
import com.hjq.http.EasyHttp;
import com.hjq.http.listener.HttpCallback;
import com.lc.cehui.R;
import com.lc.cehui.app.AppActivity;
import com.lc.cehui.http.request.AgreeApi;
import com.lc.cehui.http.response.AgressBean;

import butterknife.BindView;

public class AgreeActivity extends AppActivity {
    @BindView(R.id.titleBar)
    TitleBar titleBar;
    @BindView(R.id.text)
    TextView text;
    @Override
    protected int getLayoutId() {
        return R.layout.activity_agree;
    }

    @Override
    protected void initView() {
        titleBar.setTitle(getIntent().getStringExtra("title"));
        EasyHttp.post(this)
                .api(new AgreeApi().setId(getIntent().getStringExtra("id")))
                .request(new HttpCallback<AgressBean>(this) {

                    @Override
                    public void onSucceed(AgressBean data) {

                        if (data.getCode().equals("200")) {
                         text.setText(Html.fromHtml(data.getData().getContent()));
                            titleBar.setTitle(data.getData().getTitle());
                        }

                    }
                });
    }

    @Override
    protected void initData() {

    }
}
